package com.paradise.phone;

import android.app.Application;
import android.content.SharedPreferences;

import com.paradise.api.FacePhone;
import com.paradise.phone.utils.CrashHandler;

/**
 * Created by Sisyphus on 2017/9/6.
 */

public class FacephoneApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();

        /**
         * facephone初始化
         */
        FacePhone.instance().initPhone(this, R.raw.oldphone_mono,
                R.raw.ringback, R.raw.toy_mono, R.raw.incoming_chat,
                R.raw.lpconfig, R.raw.rootca, null);

        /**
         * 全局崩溃信息拦截
         */
        SharedPreferences pref = getSharedPreferences("face_phone", MODE_PRIVATE);
        if (pref.getBoolean("open_crash_handler", true)) {
            CrashHandler.getInstance().init(this);
        }
    }
}
